<template>
  <div class="warp">
    <button type="info" class="bs button smbtn" @click="scan">扫码进货</button>
    <div class="form-row">
      <div class="form-row-label">礼花</div>
      <div class="form-row-last">箱</div>
    </div>
    <div class="form-row">
      <div class="form-row-label">鞭炮</div>
      <div class="form-row-last">盒</div>
    </div>
    <div class="form-row">
      <div class="form-row-label">鞭炮</div>
      <div class="form-row-last">盒</div>
    </div>
    <div class="form-row teds">
      <div class="form-row-label">总金额</div>
      <div class="form-row-content">
        <input class="input" type="number" v-model="formData.je" :step="2" />
      </div>
      <div class="form-row-last">￥</div>
    </div>
    <button
      class="button bs"
      type="primary"
      @click="saveData"
      :loading="saveLoading"
    >
      确认订单
    </button>
  </div>
</template>

<script>
import store from "@/store/store";

export default {
  name: "Index",
  data() {
    return {
      saveLoading: false,
      formData: {
        total: "",
        data: [
          // {
          //   spbh: "",
          //   zl: "",
          //   gg: "",
          //   ms: "",
          //   scqymc: ""
          // }
        ]
      },
      items: [
        { name: "箱", value: "箱", checked: true },
        { name: "盒", value: "盒" }
      ],
      code: ""
    };
  },
  computed: {
    companyId() {
      return store.state.companyId;
    }
  },
  methods: {
    scan() {
      uni.scan({
        scanType: ["qrCode", "barCode"],
        success: res => {
          uni.alert({ title: res.code });
          // this.code = res.code;
        }
      });
    }
  }
};
</script>

<style scoped lang="scss">
@import "../../common/common";

div {
  box-sizing: border-box;
}

.bs {
  margin: 10px 0;
}

.warp {
  display: flex;
  background-color: #f3f3f3;
  height: 100vh;
  width: 100vw;
  padding: 20px 15px;
  flex-direction: column;
  box-sizing: border-box;

  .form-row {
    display: flex;
    align-items: center;
    color: rgb(51, 51, 51);
    height: 50px;
    background-color: #fff;
    padding: 6px 10px;
    justify-content: space-between;
    border-bottom: 0.5px solid #f5f5f5;

    .form-row-label {
      width: 120px;
      margin-bottom: 1px;
      font-size: 16px;
      color: #7d7d7d;
    }

    .form-row-content {
      flex: 1;
      display: flex;
      font-size: 12px;

      .input {
        padding: 4px 8px 4px 0;
        font-size: 15px;
        flex: 1;
      }
      .input[disabled="true"] {
        background-color: #a0a0a0;
      }
    }
    .form-row-last {
    }
  }

  .hhd {
    background-color: rgba(221, 221, 221, 0.25);
    border: 1px solid #fff;
  }

  .cxso {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: cornflowerblue;
    font-size: 14px;
    background-color: #ffffff;
    margin-bottom: 1px;
    font-weight: bold;
  }
}

.radio {
  display: block;
  margin-bottom: 20px;
}

.radio-text {
  line-height: 1.8;
}

.radio-group {
  display: flex;
  align-items: center;

  label {
    margin: 2px 20px 0 0;
  }
}
.smbtn {
  background-color: #3fdf69;
  color: #fff;
}
.teds {
  margin-top: 15px;
}
</style>
